package com.syx.security.Exception;

import com.syx.commoncore.Model.Result;
import com.syx.commoncore.enums.Resultcode;

public class ServiceException extends RuntimeException{
    protected Result errorResult;
    private Resultcode resultcode;

    public ServiceException(Result errorResult){
        super(errorResult.getMessage());
        this.errorResult=errorResult;
    }
    public Resultcode getResultcode(){
        return resultcode;
    }

    public Result getErrorResult() {
        return errorResult;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
    }

    public ServiceException(String message) {
        super(message);

    }

    public ServiceException(Throwable cause) {
        super(cause);
    }
    public ServiceException(Resultcode resultcode){
        super(resultcode.getMessage());
        this.resultcode=resultcode;

    }

}
